import { GCellRenderer } from "../../../../../com/mui/controls/GCellRenderer";
import { ObjCreate } from "../../common/ObjCreate";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
import { ImagesConst } from "../../../resource/ImagesConst";
import { SDominionAuctionService } from "../../../../../Message/Public/SDominionAuctionService";
import { DomWarConst } from "../DomWarConst";
import { GTextFiled } from "../../../../../com/mui/controls/GTextFiled";
//class AuctionRankCellRender
    
    export  class AuctionRankCellRender extends GCellRenderer
    {
        constructor()
        {
            super();
            return;
        }

        protected /* override */ configUI(): void
        {
            super.configUI();
            var loc1=3;
            this._rankTxt = ObjCreate.createGTextField("", 0, loc1, 100, 20, this, GlobalStyle.textFormat6);
            this._rankTxt.autoSize = "left";
            var loc2=GlobalStyle.textFormat6.clone();
            loc2.align = "center";
            this._serverTxt = ObjCreate.createGTextField("", 55, loc1, 220, 20, this, loc2);
            this._serverTxt.autoSize = "center";
            this._auctionPriceTxt = ObjCreate.createGTextField("", 274, loc1, 100, 20, this, loc2);
            this._servPowerTxt = ObjCreate.createGTextField("", 422, loc1, 100, 20, this, loc2);
            ObjCreate.createBg(0, 25, 510, 2, this, ImagesConst.SplitLine);
            return;
        }

        /* internal  */get info(): SDominionAuctionService
        {
            if (this._data == null) 
            {
                return null;
            }
            return this._data.info as SDominionAuctionService;
        }

        public /* override */ set data(arg1: Object)
        {
            if (arg1 == null) 
            {
                return;
            }
            super.data = arg1;
            if (this.info) 
            {
                this._rankTxt.text = this._data.rank.toString();
                this._serverTxt.text = "【" + DomWarConst.getSerNameByDomId(this.info.ownId) + "】";
                this._auctionPriceTxt.text = "" + this.info.money;
                this._servPowerTxt.text = this.info.serviceCombat.toString();
            }
            return;
        }

        /* internal */ /* var */_rankTxt: GTextFiled;

        /* internal */ /* var */_serverTxt: GTextFiled;

        /* internal */ /* var */_auctionPriceTxt: GTextFiled;

        /* internal */ /* var */_servPowerTxt: GTextFiled;
    }
